@import '../../../../../global';

.textEllipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cubeDropContent {
  background-color: white;
  border: 0.5px solid @borderColor;
  border-radius: 4px;
  overflow: hidden;
  .cubeDropContentHeader {
    user-select: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 36px;
    cursor: pointer;
    border-bottom: 1px solid @borderColor;
    .cubeDropContentHeaderIcon {
      position: relative;
      flex: 0 0 auto;
      width: 36px;
      text-align: center;
      .cubeDropContentHeaderIconArrowTop {
        position: absolute;
        left: 50%;
        bottom: 0;
        display: inline-block;
        transform: translate(-50%, 4px);
        transition: transform 0.3s ease;
      }
      .cubeDropContentHeaderIconArrowBottom {
        position: absolute;
        display: inline-block;
        top: 0;
        left: 50%;
        transform: translate(-50%, -4px) rotateX(180deg);
        transition: transform 0.3s ease;
      }
      .cubeDropContentHeaderIconClose {
        position: relative;
        display: inline-block;
        width: 36px;
        height: 35px;
        vertical-align: middle;
        &:before,
        &:after {
          content: '';
          width: 20px;
          height: 2px;
          border-radius: 1px;
          position: absolute;
          top: 50%;
          left: 50%;
          background-color: #b9b9b9;
          transition: all 0.3s ease;
        }
        &:before {
          transform: translate(-50%, -50%) rotate(-45deg);
        }
        &:after {
          transform: translate(-50%, -50%) rotate(45deg);
        }
        &:hover {
          &:before {
            background-color: darken(#b9b9b9, 10%);
            transform: translate(-50%, -50%) rotate(45deg);
          }
          &:after {
            background-color: darken(#b9b9b9, 10%);
            transform: translate(-50%, -50%) rotate(315deg);
          }
        }
      }
    }
    .cubeDropContentHeaderTitle {
      flex: 1 1 auto;
      .textEllipsis;
      .cubeDropContentHeaderTitleDescription {
        font-weight: bold;
      }
    }
    &:hover {
      background-color: fade(@borderColor, 15%);
    }
  }
  .cubeDropContentDetail {
    padding: 16px 20px;
    .cubeDropContentBreadcrumb {
      line-height: 20px;
      margin-bottom: 8px;
      .textEllipsis;
    }
    .cubeDropContentSearch {
      display: inline-block;
      position: relative;
      margin-bottom: 8px;
      input {
        margin: 0;
        width: 280px;
        border: 1px solid @borderColor;
        border-radius: 4px;
        padding-left: 24px;
        padding-right: 24px;
        & + .inputCleanIcon {
          position: absolute;
          display: none;
          width: 16px;
          height: 16px;
          border-radius: 50%;
          background-color: @borderColor;
          right: 4px;
          top: 50%;
          transform: translateY(-50%);
          cursor: pointer;
          &:before,
          &:after {
            position: absolute;
            top: 50%;
            left: 50%;
            content: '';
            width: 10px;
            height: 2px;
            border-radius: 1px;
            background-color: white;
          }
          &:before {
            transform: translate(-50%, -50%) rotate(45deg);
          }
          &:after {
            transform: translate(-50%, -50%) rotate(-45deg);
          }
          &:hover {
            display: inline-block;
          }
        }
        &:hover + .inputCleanIcon {
          display: inline-block;
        }
        &:focus-visible {
          outline-color: @successColor;
        }
      }
      .inputSearchIcon {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translate(4px, -50%) scale(0.75);
        transform-origin: center;
      }
    }
    .cubeDropContentSelectControl {
      user-select: none;
      font-weight: bold;
      line-height: 20px;
      .cubeDropContentSelectControlClear {
        color: @successColor;
        margin-right: 12px;
        cursor: pointer;
        &:hover {
          color: darken(@successColor, 10%);
        }
      }
    }
    .cubeDropContentSelectList {
      user-select: none;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      flex-wrap: wrap;
      .cubeDropContentSelectListItem {
        position: relative;
        width: 33%;
        padding-left: 8px;
        padding-right: 16px;
        line-height: 32px;
        cursor: pointer;
        font-weight: 500;
        color: @textSecondaryColor;
        input[type='checkbox'] {
          position: relative;
          bottom: -1px;
          left: -4px;
        }
        & > span:last-child {
          float: right;
          font-weight: normal;
          color: @textColor;
        }
      }
      .cubeDropContentSelectListEmpty {
        line-height: 32px;
        color: @textSecondaryColor;
      }
    }
  }
  &.collapsed {
    height: 36px;
    .cubeDropContentHeader
      .cubeDropContentHeaderIcon
      .cubeDropContentHeaderIconArrowTop {
      transform: translate(-50%, 4px) rotateX(180deg);
    }
    .cubeDropContentHeader
      .cubeDropContentHeaderIcon
      .cubeDropContentHeaderIconArrowBottom {
      transform: translate(-50%, -4px);
    }
  }
}
